package com.ktvme;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
import zipkin2.reporter.Sender;
import zipkin2.reporter.kafka11.KafkaSender;

import javax.annotation.Resource;

@SpringBootApplication
@EnableDiscoveryClient
public class SbApplication implements CommandLineRunner {

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(SbApplication.class, args);
    }

    @Resource
    private KafkaProperties kafkaProperties;

    @Override
    public void run(String... args) throws Exception {
        System.out.println(kafkaProperties.toString());
    }
}
